package com.example.sys.controller;

import com.example.sys.entity.dto.RoleDto;
import com.example.sys.service.RoleService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("role")
public class RoleController {
    @Resource
    private RoleService roleService;

    @PostMapping
    public String insertRole(@RequestBody @Validated(RoleDto.insert.class)RoleDto roleDto){
        roleService.insertRole(roleDto);
        return "success";
    }
}